subnav = function (id) {
    var $_subnav = this;
    
    $_subnav.off = false;
    if (($.browser.msie) && (parseInt($.browser.version)==7)) $_subnav.off=true;
    
    $_subnav.id = (id ? id : "navmenu");
    
    $_subnav.backgroundColor = "#1ABEEC";
    //$_subnav.backgroundColor = "white";
    $_subnav.show = function (id) {   
        window.sessionStorage.nav_id = id;
        if(! $_subnav.off) {
            //$("#" + $_subnav.id + "  li > ul").not("#subnav_" + id).slideUp('fast')
            $("ul[id*=subnav_]").not("#subnav_" + id).slideUp('fast')
            $("#subnav_" + id).slideToggle('fast');
            set_height();
            return false;
        } else return true;
    };
    
    $_subnav.clear = function (id) {
        window.sessionStorage.nav_id = undefined;
    };
    
    $(document).ready ( function () {
       
        if($_subnav.off==true) window.sessionStorage.nav_id = "xxxx";
        if (window.sessionStorage.nav_id != undefined) {
            $_subnav.show(window.sessionStorage.nav_id)
        }
        
        $("ul[id*=subnav_]").css({"background-color": $_subnav.backgroundColor})
    });
    
    
   
    
    if($_subnav.off) {
        $(document).ready(function () {
            $(".subnav").css({"position":"relative","display":"block"});
            $("#navmenu li").removeClass("navbar_highlight");
           set_height();
        }); 
    }
}

